package team.seekers.skill.service;

import org.springframework.transaction.annotation.Transactional;
import team.seekers.skill.entity.dao.Section;
import com.baomidou.mybatisplus.extension.service.IService;
import team.seekers.skill.entity.vo.admin.update.AdminSectionUpdateVO;
import team.seekers.skill.entity.vo.fore.list.SectionListVO;
import team.seekers.skill.entity.vo.fore.detail.SectionDetailVO;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author hbc
 * @since 2021-01-18
 */
public interface SectionService extends IService<Section> {

    List<SectionListVO> listSectionVOByChapterId(String chapterId, String userId);


    List<AdminSectionUpdateVO> listAdminSectionUpdateVOByChapterId(String chapterId);

    //开始学习某一节
    @Transactional(rollbackFor=Exception.class)
    boolean startLearn(String sectionId,String userId);

    // 学完某一节
    @Transactional(rollbackFor=Exception.class)
    boolean endLearn(String sectionId, String userId);

    @Transactional(rollbackFor=Exception.class)
    boolean delete(String sectionId);

    @Transactional(rollbackFor=Exception.class)
    boolean removeByChapterId(String chapterId);

    SectionDetailVO getSectionDetailVO(String sectionId);
}
